Skip to content

feat(gitlab): add configuration persistence and resource browsing#7121

Open
asaphko wants to merge 4 commits intofeature/gitlab-clientfrom
feature/gitlab-config
Open

feat(gitlab): add configuration persistence and resource browsing#7121
asaphko wants to merge 4 commits intofeature/gitlab-clientfrom
feature/gitlab-config

Conversation

@asaphko
Copy link
Copy Markdown
Contributor

@asaphko asaphko commented Apr 3, 2026

Add GitLabConfiguration model with CRUD viewset and resource browsing endpoints. Second PR in the stacked series splitting #7028, building on #7120 (client).

Changes

  • GitLabConfiguration model with soft-delete, lifecycle hooks for tag creation and external resource cleanup
  • CRUD viewset with separate create/read serialisers (access_token is write-only)
  • Resource browsing endpoints: projects, issues, merge requests, project members
  • DRF-based query param validation (replaced DataclassSerializer with proper serialisers)
  • Multi-repo support by design — no unique constraint on project FK
  • ResourceType.GITLAB_ISSUE / GITLAB_MR, TagType.GITLAB, VCSProvider.GITLAB
  • Conftest fixture, 40 tests (20 unique, parameterised across auth types)

Contributes to #7028
Stacks on #7120

Review effort: 3/5

Review feedback addressed from #7028

  • access_token write-only on create serialiser (khvn26: security fix)
  • Removed no-op extra_kwargs and dead destroy override (khvn26, emyller)
  • Multi-repo support — removed UniqueConstraint on project (emyller: "ties a Flagsmith project to a single repository")
  • Replaced DataclassSerializer with proper DRF serialisers (khvn26: "validation logic should live in the serialiser")
  • Fixed permission class naming HasPermissionToGitLabConfiguration (emyller)
  • Error handler includes actual error message in response (khvn26: "swallows it")
  • Removed cleanup issue endpoint (emyller: "way too experimental")
  • Fixed exception message (emyller: "text seems odd")
  • Batched tag creation with bulk_create (emyller: "batch these")
  • Proper type annotations — mypy strict clean, minimal type: ignore
  • Top-level imports where possible, local imports only for circular dependency avoidance
  • British English (COLOUR)

🤖 Generated with Claude Code

@asaphko asaphko requested a review from a team as a code owner April 3, 2026 13:21
@asaphko asaphko requested review from emyller and removed request for a team April 3, 2026 13:21
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped — your organization's overage spend limit has been reached.

Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.

Once credits are available, reopen this pull request to trigger a review.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview Apr 6, 2026 10:11am
flagsmith-frontend-preview Ignored Ignored Preview Apr 6, 2026 10:11am
flagsmith-frontend-staging Ignored Ignored Preview Apr 6, 2026 10:11am

Request Review

@github-actions github-actions bot added api Issue related to the REST API feature New feature or request labels Apr 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-e2e:pr-7121 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-7121 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api-test:pr-7121 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api:pr-7121 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-7121 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-7121 Finished ✅ Results

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.35%. Comparing base (8e7094d) to head (cac8164).

Additional details and impacted files
@@                   Coverage Diff                   @@
##           feature/gitlab-client    #7121    +/-   ##
=======================================================
  Coverage                  98.35%   98.35%            
=======================================================
  Files                       1342     1352    +10     
  Lines                      50371    50595   +224     
=======================================================
+ Hits                       49541    49763   +222     
- Misses                       830      832     +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  24 seconds
commit  cb3a6ef
info  🔄 Run: #15693 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  49 seconds
commit  a791102
info  🔄 Run: #15692 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  55.1 seconds
commit  cb3a6ef
info  🔄 Run: #15693 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  43.9 seconds
commit  a791102
info  🔄 Run: #15692 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  1 minute, 8 seconds
commit  a791102
info  🔄 Run: #15692 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  26 seconds
commit  54c9b1c
info  🔄 Run: #15716 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  43 seconds
commit  5f41423
info  🔄 Run: #15719 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  10.9 seconds
commit  54c9b1c
info  🔄 Run: #15716 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  46.8 seconds
commit  5f41423
info  🔄 Run: #15719 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  16 passed

Details

stats  16 tests across 13 suites
duration  28.3 seconds
commit  54c9b1c
info  🔄 Run: #15716 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  56.9 seconds
commit  54c9b1c
info  🔄 Run: #15716 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  8.9 seconds
commit  42eddf8
info  🔄 Run: #15727 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  9.1 seconds
commit  83cc13a
info  🔄 Run: #15730 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  27.2 seconds
commit  42eddf8
info  🔄 Run: #15727 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  28.8 seconds
commit  83cc13a
info  🔄 Run: #15730 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  16 passed

Details

stats  16 tests across 13 suites
duration  56.3 seconds
commit  42eddf8
info  🔄 Run: #15727 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  54 seconds
commit  42eddf8
info  🔄 Run: #15727 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  8.9 seconds
commit  1ffec12
info  🔄 Run: #15734 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  51 seconds
commit  1ffec12
info  🔄 Run: #15734 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

failed  2 failed

Details

stats  2 tests across 2 suites
duration  32.7 seconds
commit  1ffec12
info  📦 Artifacts: View test results and HTML report
🔄 Run: #15734 (attempt 1)

Failed tests

firefox › tests/change-request-test.pw.ts › Change Request Tests › Change requests can be created, approved, and published with 4-eyes approval @enterprise
firefox › tests/roles-test.pw.ts › Roles Tests › Roles can be created with project and environment permissions @enterprise

### Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  45.5 seconds
commit  1ffec12
info  🔄 Run: #15734 (attempt 2)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  1 minute, 2 seconds
commit  1ffec12
info  🔄 Run: #15734 (attempt 2)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  42.5 seconds
commit  cac8164
info  🔄 Run: #15741 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  10 passed

Details

stats  10 tests across 7 suites
duration  28 seconds
commit  cac8164
info  🔄 Run: #15741 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  42.8 seconds
commit  cac8164
info  🔄 Run: #15741 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  16 passed

Details

stats  16 tests across 13 suites
duration  1 minute, 4 seconds
commit  cac8164
info  🔄 Run: #15741 (attempt 1)

@asaphko asaphko force-pushed the feature/gitlab-config branch from cb3a6ef to 54c9b1c Compare April 6, 2026 08:06
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Apr 6, 2026
…sing

Add GitLabConfiguration model, CRUD viewset, and resource browsing
endpoints (projects, issues, MRs, members). Multi-repo support by
design — no unique constraint on project FK.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@asaphko asaphko force-pushed the feature/gitlab-config branch from 5f41423 to 42eddf8 Compare April 6, 2026 08:54
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Apr 6, 2026
pre-commit-ci bot and others added 2 commits April 6, 2026 08:55
Remove duplicate-catching code path that became unreachable after
removing the UniqueConstraint for multi-repo support.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Apr 6, 2026
The DuplicateGitLabIntegration exception is no longer used after
removing the IntegrityError handling (multi-repo support).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Issue related to the REST API feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant